$(document).ready(function() {
	setBook3D();
});
$(window).resize(function() {
	setBook3D();
});
function setBook3D() {
	book_width = $('figure.book .cover').innerWidth();
	book_height = book_width * 1.5;
	perspective = book_width * 2;
	$('figure.book .cover').css('height',book_height);
	$('figure.book .cover').css('padding-top',book_height/10);
	$('figure.book .cover img').css({
		'transform': 'perspective(' + perspective + 'px) rotateY(-23deg)',
		'-o-transform': 'perspective(' + perspective + 'px) rotateY(-23deg)',
		'-ms-transform': 'perspective(' + perspective + 'px) rotateY(-23deg)',
		'-moz-transform': 'perspective(' + perspective + 'px) rotateY(-23deg)',
		'-webkit-transform': 'perspective(' + perspective + 'px) rotateY(-23deg)',
	});
}